package operate;

import book.BookList;
import book.Books;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-23
 * Time: 22:17
 */
public class AddOperat implements Ioperate{
    @Override
    public void work(BookList bookList) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要添加的书名");
        String name = scanner.nextLine();
        System.out.println("请输入书的作者");
        String writer = scanner.nextLine();
        System.out.println("请输入书的价格");
        int price = scanner.nextInt();
        Books books = new Books(name,writer,price);
        bookList.getBookList()[bookList.getBooknumber()] = books;
        bookList.setBooknumber(bookList.getBooknumber() + 1);

    }
}
